package com.web44.spring.service.impl;

import com.web44.spring.mapper.StudentMapper;
import com.web44.spring.service.StudentService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * @Title: UserServiceImpl
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/9 9:05
 */
/*
* <bean id="studentServiceImpl" class="com.web44.spring.service.impl.StudentServiceImpl"></bean>
* @Service
* @Repository
* @Component
* @Controller
*   以上的注解都是为了生成一个bean
*   bean的class 表示 当前的类
*   bean的id/name  表示 当前类名 并且首字母小写
* */
@Service("abc")
public class StudentServiceImpl implements StudentService {

    // 注入UserMapper
    //@Autowired
   // @Resource  // 优先找名字 也可以根据类型
    @Resource(name="studentMapperImpl")
    private StudentMapper studentMapper;

    @Override
    public void queryUserService() {
        System.out.println("学生处理业务逻辑.....");
        studentMapper.queryUserDao();
    }
}
